import React from 'react';
import {
  Form,
  Drawer,
  Divider, Table,
} from 'antd';

import DescriptionList from '@/components/DescriptionList';
import StandardTable from '@/components/StandardTable';

const { Description } = DescriptionList;

//查看详情
const DescView = Form.create()(props => {
  const { lookDescView, handleLookDesc, selectedRows } = props;
  let info = {
    ...selectedRows.base, ...selectedRows,
  };
  const columns = [
    {
      title: '优惠券编号',
      dataIndex: 'couponNo',
      key: 'couponNo',
    },
    {
      title: '优惠券名称',
      dataIndex: 'couponName',
      key: 'couponName',
    },

  ];
  return (
    <Drawer
      destroyOnClose
      title="用户信息"
      width={500}
      visible={lookDescView}
      closable={false}
      onClose={() => handleLookDesc(false, [])}>
      <DescriptionList size="large" style={{ marginBottom: 32 }} col="2">
        <Description term="用户编号">{info.userNo}</Description>
        <Description term="手机号">{info.mobile}</Description>
        <Description term="是否实名">{info.account === 1 ? '已实名' : '未实名'}</Description>
        <Description term="用户名称">{info.userName}</Description>
        <Description term="邀请人数">{info.inviteNum}</Description>
        <Description term="邀请人数">{info.inviteNum}</Description>
        <Description term="邀请码">{info.inviteCode}</Description>
        <Description term="等级">{info.level}</Description>
        <Description term="积分">{info.score}</Description>
      </DescriptionList>
      <Description term="签章">{info.ca}</Description>
      <Description term="注册时间">{info.regTime}</Description>
      <Divider/>
      <Table
        columns={columns}
        pagination={false}
        rowKey={'couponNo'}
        dataSource={info.couponList ? info.couponList : []}/>

    </Drawer>
  );
});

export default DescView;
